﻿using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using DynamicData;
using GitNet.WindowsApp.Models;

namespace GitNet.WindowsApp.ViewModels;

public class StartViewModel : ViewModelBase
{
    public ObservableCollection<PathData> Paths { get; set; } = new();

    public StartViewModel()
    {
        Paths.Add(ProjectData.OpenJson()?.PathData ?? new List<PathData>());
    }

    public int Inquire(string path)
    {
        var a = Paths.ToList();
        return a.FindLastIndex(x => x.RepositoryPath == path);
    }
}